#include "output/VTKOutput.h"
#include "parameter/Parameter.h"
#include "base/Application.h"

#include <vtkm/io/VTKDataSetWriter.h>

Parameter VTKOutput::ValidParams()
{
	Parameter p;
	return p;
}

void VTKOutput::Execute()
{
	if (_app.CurrentTimeStep() % _interval == 0)
	{
		auto& sys = *(_app.GetSystem());

		sys.FillField();

		char tmp[8];
		sprintf(tmp, "%06d", _app.CurrentTimeStep());
		std::string file = "system" + std::string(tmp) + ".vtk";
		vtkm::io::VTKDataSetWriter write(file);

		write.WriteDataSet(sys);
	}
}